var groupId = '';//分组id
var isCopy = false;
var isSchedule = false;
/***页面时间控件初始化参数***/
var lang = 'en';
if(i18nLanguage == 'zh-CN'){
    lang = 'cn';
}

/**上传控件国际化参数*/
var language = 'en';
if(i18nLanguage == 'zh-CN'){
    language = 'zh';
}
var hrefStatus="";
//jqGrid的配置信息
/*$.jgrid.defaults.width = 1000;
$.jgrid.defaults.responsive = true;
$.jgrid.defaults.styleUI = 'Bootstrap';*/

//工具集合Tools
window.T = {};

// 获取请求参数
// 使用示例
// location.href = http://localhost:8080/index.html?id=123
// T.p('id') --> 123;
var url = function(name) {
    var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
    var r = window.location.search.substr(1).match(reg);
    if(r!=null)return  unescape(r[2]); return null;
};
T.p = url;


var dialogModel;
var dialogParam = function () {
    var mParams = new Map();
    var dialog0 = dialogModel;
    if (dialog0 != undefined) {
        var url = dialog0.getData('value');
        if(url){
            var params = url.split('&');
            for (var i = 0; i < params.length; i++) {
                var p = params[i].split('=');
                mParams.set(p[0], p[1])
            }
        }

    }
    return mParams;

};

(function($){
    //备份jquery的ajax方法
    var _ajax=$.ajax;
    //重写jquery的ajax方法
    $.ajax=function(opt){
        //备份opt中error和success方法
        var fn = {
            error:function(XMLHttpRequest, textStatus, errorThrown){},
            success:function(data, textStatus){}
        };
        if(opt.error){
            fn.error=opt.error;
        }
        if(opt.success){
            fn.success=opt.success;
        }

        //扩展增强处理
        var _opt = $.extend(opt,{
            error:function(XMLHttpRequest, textStatus, errorThrown){
                //错误方法增强处理
                fn.error(XMLHttpRequest, textStatus, errorThrown);
            },
            success:function(data, textStatus,xhr){
                //成功回调方法增强处理
                if(xhr.getResponseHeader("accessToken") != null){
                    window.localStorage.Authorization = xhr.getResponseHeader("accessToken");
                }
                fn.success(data, textStatus);
            },
            statusCode: {//传入statusCode对象，定义对状态码操作的方法
                401 : function() {//900为服务器返回的自定义状态码，说明当前操作没有权限
                    console.log("没有权限！");
                    parent.location.href = window.localStorage.homePage;

                }
            }
        });
        // _ajax(_opt);
        return _ajax(_opt);
    };
})(jQuery);

//全局配置
$.ajaxSetup({
    dataType: "json",
    contentType: "application/json",
    headers: { // 默认添加请求头
        "Authorization": window.localStorage.Authorization
    },
    cache: false
});



function hasPermission(permission) {
    if (window.parent.permissions!=null && window.parent.permissions.indexOf(permission) > -1) {
        return true;
    } else {
        return false;
    }
}

//重写alert
window.alert = function(msg, callback,icon){
    parent.layer.alert(msg,
        {
            title : [ pageData.tip , true],
            btn: [ pageData.sure],
            icon:icon,
            closeBtn: 0
        },
        function(index){
            parent.layer.close(index);
            if(typeof(callback) === "function"){
                callback("ok");
            }
        });
};

//重写confirm式样框
window.confirm = function(msg, callback){
    parent.layer.confirm(msg, {
            btn: [ pageData.sure, pageData.cancel ],
            icon: 0,
            title : [ pageData.tip , true],
        },
        function(index){//确定事件
            parent.layer.close(index);
            parent.layer.msg( pageData.onloadTip, {icon: 16,shade: [0.3, '#000'],scrollbar: false,offset: '300px', time:100000000}) ;
            if(typeof(callback) === "function"){
                callback("ok");
            }
        });
};
/*window.confirm = function(msg, callback,callbackFalse){
	parent.layer.confirm(msg, {
		btn: [ pageData.sure, pageData.cancel ],
		title : [ pageData.tip , true],
	},
	function(index){//确定事件
		parent.layer.close(index);
		parent.layer.msg( pageData.onloadTip, {icon: 16,shade: [0.3, '#000'],scrollbar: false,offset: '300px', time:100000000}) ;
		if(typeof(callback) === "function"){
			callback("ok");
		}
	},
	function(){
		if(typeof(callbackFalse) === "function"){
			callbackFalse.call(null);
		}
	});
}*/

//选择一条记录
function getSelectedRow() {
    var grid = $("#jqGrid");
    var rowKey = grid.getGridParam("selrow");
    if(!rowKey){
        alert(pageData.selectOne);
        return ;
    }

    var selectedIDs = grid.getGridParam("selarrrow");
    if(selectedIDs.length > 1){
        alert(pageData.onlyOne);
        return ;
    }

    return selectedIDs[0];
}


//选择多条记录
function getSelectedRows() {
    var grid = $("#jqGrid");
    var rowKey = grid.getGridParam("selrow");
    if(!rowKey){
        alert(pageData.selectOne);
        return ;
    }

    return grid.getGridParam("selarrrow");
}

//选择一条记录--用于bootstrap boot
function getSelectRow(table) {
    var row=$.map(table.bootstrapTable('getSelections'),function(row){
        return row ;
    });
    if(!row||row.length==0){
        alert(pageData.selectOne);
        return ;
    }
    if(row.length>1){
        alert(pageData.selectOne);
        return ;
    }
    return row[0].id;
}

function getSelectRowData(table) {
    var row=$.map(table.bootstrapTable('getSelections'),function(row){
        return row ;
    });
    if(!row||row.length==0){
        alert(pageData.selectOne);
        return ;
    }
    if(row.length>1){
        alert(pageData.selectOne);
        return ;
    }
    return row[0];
}


function getSelectRows(table) {
    var selected = [];
    var row=$.map(table.bootstrapTable('getSelections'),function(row){
        return row ;
    });
    if(!row||row.length==0){
        alert(pageData.selectOne);
        return ;
    }
    for(var i=0;i<row.length;i++){
        selected.push(row[i].id);
    }
    return selected;
}

function getSelectIds(table){
    var selected = [];
    var row=$.map(table.bootstrapTable('getSelections'),function(row){
        return row ;
    });
    if(!row||row.length==0){
        return ;
    }
    for(var i=0;i<row.length;i++){
        selected.push(row[i].id);
    }
    return selected;
}


//动态高度
function getHeight() {
    alert($(window).height());
    return $(window).height() - 100;
}



//按钮致灰
//复选框点击事件
function resetOperBtn(){
    var deleteBtn=false;
    var auditSubmit = false;
    var auditPass = false;
    var auditNoPass = false;
    var updateBtn = false;
    var usedBtn = false;
    var stopBtn = false;
    var injectBtn = false;
    var uninjectBtn = false;
    var revoke = false;
    var pauseBtn = false;
    var rows = $("#table").bootstrapTable('getSelections');
    for (var i = 0; i < rows.length; i++) {
        var status;
        if(rows[i].status !== undefined && rows[i].status !== null){
            status = rows[i].status;
        }else{
            status = rows[i].auditStatus;
        }
        if(status==0){
            auditPass=true;
            auditNoPass=true;
            stopBtn = true;
            injectBtn = true;
            uninjectBtn = true;
            pauseBtn = true;
        }else if(status==1){
            updateBtn=true;
            deleteBtn=true;
            auditSubmit=true;
            injectBtn = true;
            uninjectBtn = true;
            pauseBtn = true;
            revoke = true;
        }else if(status==2){
            updateBtn=true;
            deleteBtn=true;
            auditSubmit=true;
            auditPass=true;
            uninjectBtn = true;
            revoke = true;

        }else if(status==3){
            auditPass=true;
            auditNoPass=true;
            injectBtn = true;
            uninjectBtn = true;
            pauseBtn = true;
        }else if (status == 4) {
            updateBtn=true;
            deleteBtn=true;
            auditSubmit=true;
            auditPass=true;
            auditNoPass=true;
            injectBtn = true;
            revoke = true;
        }else if (status == 5) {
            updateBtn=true;
            deleteBtn=true;
            auditSubmit=true;
            auditPass=true;
            uninjectBtn = true;
        }else if(status==6){
            //投放排期的暂停
            auditPass = true;
            auditNoPass = true;
            pauseBtn = true;
            deleteBtn=true;
        }else if(status==8){
            usedBtn = true;
            updateBtn=true;
            deleteBtn=true;
        }else if(status==9){
            stopBtn = true;
        }else if(status==10){
            usedBtn = true;
            deleteBtn=true;
            updateBtn=true;
        }else if(status==11){
            usedBtn = true;
            deleteBtn=true;
            updateBtn=true;
        }else if(status == 12){
            //注入中
            updateBtn=true;
            deleteBtn=true;
            auditSubmit=true;
            auditPass=true;
            auditNoPass=true;
            injectBtn = true;
            uninjectBtn = true;
        }else if(status == 13){
            //取消注入中
            updateBtn=true;
            deleteBtn=true;
            auditSubmit=true;
            auditPass=true;
            auditNoPass=true;
            injectBtn = true;
            uninjectBtn = true;
        }else if(status == 14){
            //注入失败
            updateBtn=true;
            deleteBtn=true;
            auditSubmit=true;
            auditPass=true;
            //auditNoPass=true;
            //injectBtn = true;
            uninjectBtn = true;
        }else if(status == 15){
            //取消注入失败
            updateBtn=true;
            deleteBtn=true;
            auditSubmit=true;
            auditPass=true;
            auditNoPass=true;
            injectBtn = true;
            //uninjectBtn = true;
        }
    }
    $("#update").attr("disabled",updateBtn);
    $("#delete").attr("disabled",deleteBtn);
    $("#submit").attr("disabled",auditSubmit);
    $("#checkOk").attr("disabled",auditPass);
    $("#auditpass").attr("disabled",auditPass);
    $("#checkFail").attr("disabled",auditNoPass);
    $("#auditnopass").attr("disabled",auditNoPass);
    $("#used").attr("disabled",usedBtn);
    $("#stopUsed").attr("disabled",stopBtn);
    $("#inject").attr("disabled",injectBtn);
    $("#uninject").attr("disabled",uninjectBtn);
    $("#revoke").attr("disabled", revoke);
    $("#pause").attr("disabled", pauseBtn);
}

//恢复操作按钮
function recoverBtn(){
    $("#update").attr("disabled",false);
    $("#delete").attr("disabled",false);
    $("#submit").attr("disabled",false);
    $("#checkOk").attr("disabled",false);
    $("#checkFail").attr("disabled",false);
}

//查询是否被关联
function checkRelated (tableName, param , id) {
    var flag = false;

    jQuery.ajax({
        url:$path+'/common/check?tableName='+tableName+'&param='+param+'&id='+id,
        type:"POST",
        async:false,
        success:function(r){
            if (r.count > 0) {
                flag = true;
            }
        }
    });
    return flag;

}
//查询被关联的对象信息
function queryRelated (tableName, param , id) {
    var obj = {};
    debugger;
    jQuery.ajax({
        url:'../common/queryObject?tableName='+tableName+'&param='+param+'&id='+id,
        type:"POST",
        async:false,
        success:function(r){
            if (r.code == 0) {
                obj = r.result;
            }
        }
    });
    return obj;

}

/**
 * 数组去重
 * @param a
 */
function outRepeat(a){
    var hash=[],arr=[];
    for (var i = 0; i < a.length; i++) {
        hash[a[i]]!=null;
        if(!hash[a[i]]){
            arr.push(a[i]);
            hash[a[i]]=true;
        }
    }
    return arr;
}


//删除数组某一个元素
function delElement(e, array){
    var index = $.inArray(e,array);
    if(index>=0){
//arrayObject.splice(index,howmany,item1,.....,itemX)

//参数    描述
//index  必需。整数，规定添加/删除项目的位置，使用负数可从数组结尾处规定位置。
//howmany 必需。要删除的项目数量。如果设置为 0，则不会删除项目。
//item1, ..., itemX 可选。向数组添加的新项目。
        array.splice(index,1);
        //alert(a.toString());
    }else{
        //alert("error");
        return false;
    }
}

function delObj (obj , array) {
    for (var i = 0; i < array.length; i++) {
        if (obj.id == array[i].id) {
            array.splice(i,1);
            return true;
        }
    }
    alert('The object is not found!');
    return false;
}

//全局获取到basedata数据
var allBaseData;
/*var url = "../sys/sysbasedata/getAllBaseData";
jQuery.get(url , function(r){
	allBaseData = r.allBaseDataMap;
})

//封装获取basedata的方法
function getDataByType (dataType , key) {
	var dataList = allBaseData[dataType];
	var baseData =  [];
	//对KEY进行处理
	if (typeof key == 'string' && key.indexOf(",") >= 0) {
		key = key.split(",");
	}else if (typeof key == "number") {
		var tem = key;
		key = [];
		key.push(tem);
	}
	//封装数组对象返回
	jQuery.each(key , function(i , data){
		jQuery.each(dataList , function(index , obj){
			if (obj.language == 'zh-CN' && obj.key == data) {
				baseData.push(obj.value);
			}
		});
	});
	
	return baseData;
}

//获取全部类型
function getDataAllType () {
	var newObj = {};
	$.each(allBaseData, function(key , obj){
		var newArr = [];
		$.each(obj , function(i , data){
			if (data.language == 'zh-CN') {
				data.key = data.key + '';
				newArr.push(data);
			}
		});
		newObj[key] = newArr;
	});
	console.log(newObj);
	return newObj;
}
*/

//获取url传递的参数
function getHref() {
    // debugger;
    var url = location.search; //获取url中"?"符后的字串
    var theRequest = {};
    if (url.indexOf("?") != -1) {
        var str = url.substr(1);
        strs = str.split("&");
        for(var i = 0; i < strs.length; i ++) {
            theRequest[strs[i].split("=")[0]]=(strs[i].split("=")[1]);
        }
    }
    return theRequest;
}

//获取待办事项的数目
function changeDb(){
    var dbCount = 0;
    $.ajax({
        type: "POST",
        url: $path + "sys/sysMessage/messageList",
        data: "",
        success: function(r){
            dbCount = r.dBcount;
            $('.waitDo', window.parent.document).attr('data-text',dbCount);
        }
    });
}

//获取未读消息的数目
function changeInfo(url){
    var infoCount = 0;
    $.ajax({
        type: "POST",
        url: $path + url,
        data: "",
        success: function(r){
            infoCount = r.msgCount;
            $('.newMes', window.parent.document).attr('data-text',infoCount);
        }
    });
}

//默认请选择
var sel = $('.def').prev(),
    flag = false;
function defHide(){
    if(flag){
        $('.def').hide();
        flag = false;
    }
}
function flagChange(){
    flag = true;
}


$(function () {
    //新增修改页面禁止enter键提交
    $("#defaultForm").keydown(function(){
        if(event.keyCode==13)return false;
    });
    //查询条件不能输入空
    $("#formSearch").keypress(function(){
        if(event.keyCode==32)return false;
    });
    //查询条件不能输入空
    $("#formDialogSearch").keypress(function(){
        if(event.keyCode==32)return false;
    });
});


$(function () {
    var bTimeMin = "1900-01-01 00:00:00";
    var eTimeMax = "2900-01-01 00:00:00";
    //初始化查询控件
    if( typeof laydate != "undefined"){
        if(typeof initDate != "undefined" && initDate == 1){
            bTimeMin =new Date(new Date()-6*24*60*60*1000).format("yyyy-MM-dd");
            eTimeMax = new Date().format("yyyy-MM-dd");
            $("#beginTime").val(bTimeMin);
            $("#endTime").val(eTimeMax);
            vm.search.endTime = eTimeMax;
            vm.search.beginTime = bTimeMin;
            var beginTime = laydate.render({
                lang : lang,
                elem: '#beginTime',
                type: 'date',
                format:'yyyy-MM-dd',
                min:'1900-01-01 00:00:00',
                max: eTimeMax,
                btns:[ 'confirm' ],
                done:function(value , date){
                    if (value != '') {
                        date.month = date.month - 1;
                        endTime.config.min = date;
                        vm.search.beginTime = value;
                    }else {
                        date.month = date.month - 1;
                        endTime.config.min = beginTime.config.min;
                        vm.search.beginTime = value;
                    }
                }
            });
            var endTime = laydate.render({
                lang:lang,
                elem: '#endTime',
                type: 'date',
                format:'yyyy-MM-dd',
                min:bTimeMin,
                max:eTimeMax,
                btns:['confirm'],
                done:function(value , date){
                    if (value != '') {
                        date.month = date.month - 1;
                        beginTime.config.max = date;
                        vm.search.endTime = value;
                    }else {
                        date.month = date.month - 1;
                        beginTime.config.max =  endTime.config.max;
                        vm.search.endTime = value;
                    }
                }
            });
        }
    }




});



Date.prototype.format = function(fmt) {
    var o = {
        "M+" : this.getMonth()+1,                 //月份
        "d+" : this.getDate(),                    //日
        "h+" : this.getHours(),                   //小时
        "m+" : this.getMinutes(),                 //分
        "s+" : this.getSeconds(),                 //秒
        "q+" : Math.floor((this.getMonth()+3)/3), //季度
        "S"  : this.getMilliseconds()             //毫秒
    };
    if(/(y+)/.test(fmt)) {
        fmt=fmt.replace(RegExp.$1, (this.getFullYear()+"").substr(4 - RegExp.$1.length));
    }
    for(var k in o) {
        if(new RegExp("("+ k +")").test(fmt)){
            fmt = fmt.replace(RegExp.$1, (RegExp.$1.length==1) ? (o[k]) : (("00"+ o[k]).substr((""+ o[k]).length)));
        }
    }
    return fmt;
};


var vail = {
    feedbackIcons:function(){
        return {
            valid: 'glyphicon glyphicon-ok',
            invalid: 'glyphicon glyphicon-remove',
            validating: 'glyphicon glyphicon-refresh'
        };
    },
    //非空
    NOTNULL:function(message,fieldName){
        return {
            message: 'The '+message+' is not valid',
            trigger:"change",
            validators: {
                notEmpty: {
                    message: fieldName + '不能为空！'
                }
            }
        };
    },
    //长度限制
    LIMITLENGTH:function(message,fieldName,min,max){
        return {
            message: 'The '+message+' is not valid',
            validators: {
                stringLength:{
                    min:min,
                    max:max,
                    message:fieldName + pageData.overLength + max
                }
            }
        };
    },
    //非空长度限制
    NOTNULLLIMIT:function(message,fieldName,min,max){
        return {
            message: 'The '+message+' is not valid',
            trigger:"change",
            validators: {
                notEmpty: {
                    message: fieldName + '不能为空！'
                },
                stringLength:{
                    min:min,
                    max:max,
                    message:fieldName + pageData.overLength + max
                }
            }
        };
    },
    //非空正则表达式
    NOTNULLREGEX:function(message,fieldName,regex,desc){
        if(desc == undefined || desc == ''){
            desc = '不符合匹配规则';
        }

        return {
            message: 'The '+message+' is not valid',
            trigger:"change",
            validators: {
                notEmpty: {
                    message: fieldName + '不能为空！'
                },
                regexp:{
                    regexp: regex,
                    message: fieldName + desc
                }
            }
        };
    },
    //非空正则表达式长度限制
    NOTNULLREGEXLIMIT:function(message,fieldName,min,max,regex,desc){
        if(desc == undefined || desc == ''){
            desc = '不符合匹配规则';
        }

        return {
            message: 'The '+message+' is not valid',
            trigger:"change",
            validators: {
                notEmpty: {
                    message: fieldName + '不能为空！'
                },
                stringLength:{
                    min:min,
                    max:max,
                    message:fieldName + pageData.overLength + max
                },
                regexp:{
                    regexp: regex,
                    message: fieldName + desc
                }
            }
        };
    },

    NOTNULLREGEXLIMITFORORDER:function(message,fieldName,min,max,regex,desc,type){
        console.log("type is:"+type);
        if(type == '1'){
            return '';
        }
        if(desc == undefined || desc == ''){
            desc = '不符合匹配规则';
        }

        return {
            message: 'The '+message+' is not valid',
            trigger:"change",
            validators: {
                notEmpty: {
                    message: fieldName + '不能为空！'
                },
                stringLength:{
                    min:min,
                    max:max,
                    message:fieldName + pageData.overLength + max
                },
                regexp:{
                    regexp: regex,
                    message: fieldName + desc
                }
            }
        };
    },
    //非必填正则表达式长度限制
    REGEXLIMIT:function(message,fieldName,min,max,regex,desc){
        if(desc == undefined || desc == ''){
            desc = '不符合匹配规则';
        }

        return {
            message: 'The '+message+' is not valid',
            trigger:"change",
            validators: {
                stringLength:{
                    min:min,
                    max:max,
                    message:fieldName + pageData.overLength + max
                },
                regexp:{
                    regexp: regex,
                    message: fieldName + desc
                }
            }
        };
    },
    //正则表达式
    REGEX:function(message,fieldName,regex){
        return {
            message: 'The '+message+' is not valid',
            trigger:"change",
            validators: {
                regexp:{
                    regexp: regex,
                    message: fieldName + pageData.numFormat
                }
            }
        };
    },
    //正则表达式
    REGEXS:function(message,fieldName,regex,desc){
        return {
            message: 'The '+message+' is not valid',
            trigger:"change",
            validators: {
                regexp:{
                    regexp: regex,
                    message: fieldName + desc
                }
            }
        };
    },
    //查重复
    REPEAT:function(message,fieldName,max,url,objectName,id,name,columnName){
        return {
            message: 'The '+message+' is not valid',
            trigger:"change",
            validators: {
                notEmpty: {
                    message: fieldName+pageData.notEmpty+'！'
                } ,
                stringLength: {
                    max: max,
                    message: fieldName +pageData.overLength+max+'！'
                },
                remote: {
                    url: url,
                    message: fieldName + pageData.hasExists,
                    delay: 1000,
                    type: 'GET',//请求方式
                    dataType: "json",
                    data:{
                        id : function () {
                            if(vm[objectName][id] == undefined){
                                vm[objectName][id] = "";
                            }
                            return vm[objectName][id];
                        },
                        value: function(){
                            return vm[objectName][name];
                        },
                        columnName : columnName
                    }
                }
            }
        };
    },
    NOTNULLREGEXBETWEEN:function(message,fieldName,regex,desc,min,max){
        return {
            message: 'The '+message+' is not valid',
            trigger:"change",
            validators: {
                notEmpty: {
                    message: fieldName+pageData.notEmpty+'！'
                } ,
                between:{
                    min:min,
                    max:max,
                    message: "只能在"+min+"-"+max+"之间"
                },
                regexp:{
                    regexp: regex,
                    message: fieldName +desc
                }
            }
        };
    },
    //查重复正则
    REPEATREGEX:function(message,fieldName,max,url,objectName,id,name,columnName,regex,desc){
        if(desc == undefined || desc == ''){
            desc = '不符合匹配规则';
        }
        return {
            message: 'The '+message+' is not valid',
            trigger:"change",
            validators: {
                notEmpty: {
                    message: fieldName+pageData.notEmpty+'！'
                } ,
                stringLength: {
                    max: max,
                    message: fieldName +pageData.overLength+max+'！'
                },
                regexp:{
                    regexp: regex,
                    message: fieldName + desc
                },
                remote: {
                    url: url,
                    message: fieldName + pageData.hasExists,
                    delay: 1000,
                    type: 'GET',//请求方式
                    dataType: "json",
                    data:{
                        id : function () {
                            if(vm[objectName][id] == undefined){
                                vm[objectName][id] = "";
                            }
                            return vm[objectName][id];
                        },
                        value: function(){
                            return vm[objectName][name];
                        },
                        columnName : columnName
                    }
                }
            }
        };
    }
};

//手机端 按钮效果
var results = window.matchMedia('(min-width:768px)');
var logUrl="";
window.onload=function (){
    //处理日志和关联详情
    if(vm.showList != undefined){
        var data = window.location.search;
        //处理关联详情
        if(data != null && data.indexOf("?detailId=")>=0){
            var id=data.replace("?detailId=","");
            defaultActions.assiotDetail(id);
        }else if(data!= "" && data != null && data.indexOf("&logDetailPage")>=0){//处理日志详情
            vm.showList = false;
            logUrl = $path+"/sys/syslog/info"+data+"&";
            defaultActions.logDetail();
        }
    }

    //手机端 按钮效果
    if(!results.matches){
        var aList = $('#toolbar').find('a');
        aList.each(function(ind,ele){
            if(ele.childNodes.length > 1){
                ele.childNodes[1].nodeValue = '';
            }
        });
        var colList = $('#formSearch')[0].children[0].children;
//			$('#formSearch')[0].children[0].style.position = 'relative';
        if(colList.length > 2){
            for(var i=1;i<colList.length-1;i++){
                colList[i].style.display = 'none';
            }
            $('#formSearch')[0].children[0].innerHTML += '<span id="deTail" style="position:absolute;right:18px;bottom:0;font-size:20px;font-family: cursive;">◤</span>';
            $('#deTail').click(function(){
                if($('#deTail')[0].innerText == '◤'){

                    for(var i=1;i<colList.length;i++){
                        colList[i].style.display = 'block';
                        $('#deTail')[0].innerText = '◢';
                    }
                }else{
                    for(var i=1;i<colList.length-2;i++){
                        colList[i].style.display = 'none';
                        $('#deTail')[0].innerText = '◤';
                    }
                }

            })
        }
    }

};

var theRequest = getHref();
for(var i in theRequest){//用javascript的for/in循环遍历对象的属性
    hrefStatus += i+"="+theRequest[i]+"&";
}
hrefStatus = hrefStatus.substring(0,hrefStatus.length-1);

/**
 * bootstrap-table高度自适应
 */
window.onresize=function(){
    if($table!=null){
        $table.resize(autoHeigth());
    }

    $(".slimScrollDiv").css("height",$(window).height()+"px");
    $("#app").css("height",$(window).height()+"px");

 /*   $("#app").slimScroll({
        height: $(window).height(),
        alwaysVisible: true,
    });*/
};

/*
function changeIframe() {
    init();
}*/
